package com.example.zzh.service.impl;

import com.example.zzh.entity.ZzhProductStock;
import com.example.zzh.mapper.ZzhProductMapper;
import com.example.zzh.mapper.ZzhProductStockMapper;
import com.example.zzh.service.ZzhProductStockService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * <p>
 * 产品当前库存 服务实现类
 * </p>
 *
 * @author zzh
 * @since 2023-08-14
 */
@Service
public class ZzhProductStockServiceImpl extends ServiceImpl<ZzhProductStockMapper, ZzhProductStock> implements ZzhProductStockService {

    @Resource
    private ZzhProductStockMapper zzhProductStockMapper;

    @Override
    public BigDecimal selectCurrentNumber(Long materialId) {
        return new BigDecimal(zzhProductStockMapper.selectCurrentNumber(materialId));
    }
}
